<?php

	// uncomment the following to define a path alias
	// Yii::setPathOfAlias('local','path/to/local-folder');

	// This is the main Web application configuration. Any writable
	// CWebApplication properties can be configured here.
	return array(
		'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
		'name'=>'TrabajoProject',
		'defaultController'=>'site',
		'language'=>'es',

		// preloading 'log' component
		'preload'=>array('log'),

		// autoloading model and component classes
		'import'=>array(
			'application.models.*',
			'application.components.*',
		),

		// application-level parameters that can be accessed
		// using Yii::app()->params['paramName']
		'params'=>require(dirname(__FILE__).'/params.php'),

		// application components
		'components'=>array(
		'assetManager'=>array('basePath'=>dirname(__FILE__).'/../../assets/',
							  'baseUrl'=>'/web/assets/'
							  ),
			'log'=>array(
				'class'=>'CLogRouter',
				'routes'=>array(
					array(
						'class'=>'CFileLogRoute',
						'levels'=>'error, warning',
					),
				),
			),
			'user'=>array(
				// enable cookie-based authentication
				'allowAutoLogin'=>true,
				// force 403 HTTP error if authentication needed
				'loginUrl'=>null,
			),
			'db'=>require(dirname(__FILE__).'/db.php'),
			'urlManager'=>array(
				'urlFormat'=>'path',
		  'showScriptName' => true,
				'rules'=>array(
			'inicio'=>'site/index',
			'como_funciona'=>'site/howitworks',
			'contacto'=>'site/contact',
			'colaborar'=>'site/collaborate',
			'ofertas'=>'site/offers',
      'prensa'=>'site/press',
      'enlaces'=>'site/links',
					'tag/<tag>'=>'post/list',
					'noticias'=>'post/list',
					'noticia/<id:\d+>'=>'post/show',
			'post/<id:\d+>'=>'post/show',
					'post/update/<id:\d+>'=>'post/update',
			'demandas'=>'tShirtRequest/browse',
			'buscador'=>'tShirtRequest/browse',
			'oficio/<profession>/<zone>/<id>/<return_page>'=>'tShirtRequest/view',
			'baja/id/<id>/key/<key>'=>'tShirtRequest/unsubscribe'
				),
			),
		),
	);